import request from "@/utils/request";
const serverUrl = "/pro-api"

// 登录
export function login(data: any) {
    return request({
        url: serverUrl+"/login",
        method: "post",
        data,
    })
}

// 获取用户信息
export function getUserInfo() {
    return request({
        url: serverUrl+"/user/info",
        method: "get"
    })
}

// 退出登录
export function logout() {
    return request({
        url: serverUrl+"/logout",
        method: "post"
    })
}

// 更新用户信息
export function update(data: any) {
    return request({
        url: serverUrl+"/user/update",
        method: "post",
        data
    })
}

// 更换头像
export function updateUserAvatar(data: any) {
    return request({
        url: serverUrl+"/user/avatar",
        method: "post",
        data
    })
}

// 获取验证码
export function getCode(data: any) {
    return request({
        url: serverUrl+"/email",
        method: "post",
        data
    })
}

// 注册
export function userRegister(data: any) {
    return request({
        url: serverUrl+"/register",
        method: "post",
        data
    })
}